import { ConditionList } from "~/search.match";

import { getGateway, Gateway } from "@/droplet-bus/core.define";
import { Voucher, VoucherGroup } from "@/river-voucher/schema.voucher";

import { VoucherGateway } from "@/river-voucher/dto.voucher";
import { BookQuery } from "@/pond-book/core.define";

export const VoucherBookStatGateway: Gateway = getGateway(VoucherGateway, "river_voucher_book_stat");
export type getVoucherBookStatDto = {
  conditionList: ConditionList<Voucher>;
  groupId: VoucherGroup["id"];
  query: BookQuery[];
};

export interface VoucherBookStatInterfaceWithGrant<T> {
  /** 例如：在财务记录的左下角，显示：已收款 已记账是多少 */
  getVoucherStatBook(dto: T & getVoucherBookStatDto): Promise<(BookQuery & { total: number })[]>;
}
